using System.Xml.Linq;
using System.Xml.XPath;


namespace Wayloop.Blog.Core.Extensions
{
    public static class XElementExtensions
    {
        public static string XPathSelectElementValue(this XElement element, string expression)
        {
            XElement selectedElement = element.XPathSelectElement(expression);
            if (selectedElement == null) {
                return null;
            }

            return selectedElement.Value;
        }
    }
}